home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94a.txt
/
000097_icon-group-sender _Sun Apr 24 16:51:23 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-08-19
|
2KB
Received: by cheltenham.cs.arizona.edu; Sun, 24 Apr 1994 13:53:14 MST
From: <janpeter@mpi.kun.nl>
Message-Id: <9404241551.AA17073@mpix10.mpi.kun.nl>
To: icon-group@cs.arizona.edu
Subject: Re: is this a bug?
Date: Sun, 24 Apr 94 16:51:23 +0100
X-Mts: smtp
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
First of all, thank you for the help in understanding
Icon table / list semantics. I now see what the problem
was.
Nevin Liber writes:
> Jan Peter de Ruiter proudly drove the following message along the Information SuperHype way(TM) at breakneck speeds:
I can see no indication of "proudness" in my posting. I specifically
pointed out that lack of understanding of Icon on my part is a
potential cause for my problem.
As John David Stone (stone@math.grin.edu) and Steve Wampler
(swampler@noao.edu) also pointed out, the thing I didn't realize
is that the initialisation
t := table([])
makes all table entries point at the *same* empty list.
Well, I understand now, but I must honestly say I don't
like it. The denotation [] looks like a *value* to me,
but it isn't.
I see that the statement
l1 := l2 := list()
will make "pointers" to the same list, and I can appreciate
the performance reasons behind this. What I don't like it
the difference between initialisation and assignment in
tables, for it can lead to confusing effects.
For example, the following fragments do not have the same
meaning:
# first fragment
t := table([])
put(t[1],"john")
put(t[2],"mary")
# second fragment
t := table([])
t[1] |||:= ["john"]
t[2] |||:= ["mary"]
Which is a pity, I think, for a higher level language where
you're supposed to be free of these details. This is the kind
of problem I expect to have in C++, but not in Icon.
But I am fully aware of the fact that I'll have to live with it.
And I can live with it, now I know what's going on.
Greetings,
Jan